<template>
  <div class="hometo">
    <div class="hometo-content">
      <div class="hometo-title">每日快报/出入校门统计快报</div>
      <h2 class="hometo-h2">{{time1}}进出校门数据</h2>
      <div class="hometo-table">
        <el-table
          :data="tableData"
          border
          style="width: 90%"
          :header-cell-style="{background:'#5058b1',color:'#fff'}"
        >
          <el-table-column type="index" label="#" width="50"></el-table-column>
          <el-table-column prop="college" label="部门" width="100"></el-table-column>
          <el-table-column prop="classes" label="班级" width="100"></el-table-column>
          <el-table-column prop="count" label="人数" width="100"></el-table-column>
          <el-table-column prop="names" label="名单"></el-table-column>
        </el-table>
      </div>
       
    </div>
  </div>
</template>
<script>
import Api from "../assets/js/api";
export default {
  data() {
    return {
      tableData: [],
      time1:''
    };
  },
  mounted() {
    this.hometolist();
    this.time()
  },
  methods: {
    hometolist() {
      this.$http({
        url: Api.userto,
        method: "GET"
      }).then(res => {
          console.log(res)
        this.tableData = res.data.list;
        // console.log(this.datalist);
      });
    },
    time(){
       let d=new Date()
       let year=d.getFullYear() // 获取年
       let mount=d.getMonth()+1  //获取月
       let data=d.getDate()>10?d.getDate():'0'+d.getDate() //获取日期
       this.time1=year+'-'+mount +'-'+data  
    }
  }
};
</script>
<style scoped>
.hometo {
  padding: 30px;

}
.hometo-content {
  width: 100%;
  border-radius: 12px;
  background-color: #ffffff;
}
.hometo-title {
  height: 55px;
  font-size: 14px;
  color: #a2a9d4;
  line-height: 55px;
  text-indent: 20px;
  border-bottom: 1px solid #ececff;
  margin-bottom: 15px;
}
.hometo-h2 {
  font-size: 20px;
  color: #5c6297;
  margin-top: 15px;
  margin-bottom: 15px;
  text-indent: 20px;
}
.hometo-table {
  margin-left: 20px;
  padding-bottom: 50px;
  box-sizing: border-box;
}
</style>